import http from '/@/utils/http';

/**
 * 工作台api接口集合
 * @method getDeviceCountByStatusApi 获取各状态下的设备数量
 * @method partStatisticsApi 备件统计数据
 * @method deviceFaultCensusByMonthApi 按月统计设备故障数量
 * @method getDeviceFailureListApi 查询故障前十的设备列表
 * @method selectNotRepairListApi 待维修工单列表（工作台）
 * @method webPageListApi 维保任务列表（工作台）
 * @method webPageCheckListApi 点检任务列表（工作台）
 * @method pieChartCensusApi 按照报修来源统计数量
 * @method maintainTypeProportionApi 获取指定月份维保类型占比
 * @method checkTypeProportionApi 获取指定月份点检类型占比
 * @method getUntreatedPartApi 获取未处理的备件申请或退还数量
 */

export const getDeviceCountByStatusApi = async () => {
    return await http.get(`/device/mobile/deviceInfo/getDeviceCountByStatus`)
}

export const partStatisticsApi = async () => {
    return await http.get(`/device/mobile/devicePart/partStatistics`)
}

export const deviceFaultCensusByMonthApi = async () => {
    return await http.get(`/device/mobile/deviceRepair/deviceFaultCensusByMonth`)
}

export const getDeviceFailureListApi = async (params: any) => {
    return await http.post(`/device/mobile/deviceInfo/getDeviceFailureList`, params)
}

export const selectNotRepairListApi = async () => {
    return await http.get(`/device/mobile/deviceRepair/selectNotRepairList`)
}

export const webPageListApi = async () => {
    return await http.get(`/device/mobile/deviceMaintainTask/noMaintainList`)
}

export const webPageCheckListApi = async () => {
    return await http.get(`/device/mobile/deviceCheckTask/noCheckTask`)
}

export const pieChartCensusApi = async (time: any) => {
    return await http.get(`/device/mobile/deviceRepair/pieChartCensus/${time}`)
}

export const maintainTypeProportionApi = async (time: any) => {
    return await http.get(`/device/mobile/deviceMaintainTask/maintainTypeProportion/${time}`)
}

export const checkTypeProportionApi = async (time: any) => {
    return await http.get(`/device/mobile/deviceCheckTask/checkTypeProportion/${time}`)
}

export const getUntreatedPartApi = async () => {
    return await http.get(`/device/mobile/devicePart/getUntreatedPart`)
}